<template>
	<div>
		<el-form v-model="entityQueryForm" inline size="mini" style="text-align: left">
			<el-form-item>
				<el-button @click="getEntityListByPage" type="primary" >查询</el-button>
			</el-form-item>
			<el-form-item style="float: right">
				<el-button v-if="hasAuth('account:add')" @click="showAddEntityDialogHandler" type="primary" >新增</el-button>
			</el-form-item>
		</el-form>
		<el-dialog :visible.sync="showEntityDialog" v-if="showEntityDialog" fullscreen :modal="false">
			<el-form :model="entity" label-width="130px" size="mini">
				<el-form-item label="账号">
					<el-input v-model="entity.accountNumber"></el-input>
				</el-form-item>
				<el-form-item label="年龄">
					<el-input v-model="entity.age"></el-input>
				</el-form-item>
				<el-form-item label="余额">
					<el-input v-model="entity.balance"></el-input>
				</el-form-item>
				<el-form-item label="性别">
					<el-input v-model="entity.gender"></el-input>
				</el-form-item>
				<el-form-item label="firstname">
					<el-input v-model="entity.firstname"></el-input>
				</el-form-item>
				<el-form-item label="lastname">
					<el-input v-model="entity.lastname"></el-input>
				</el-form-item>
				<el-form-item label="邮箱">
					<el-input v-model="entity.email"></el-input>
				</el-form-item>
				<el-form-item label="职位">
					<el-input v-model="entity.employer"></el-input>
				</el-form-item>
				<el-form-item label="所在城市">
					<el-input v-model="entity.city"></el-input>
				</el-form-item>
				<el-form-item label="地址">
					<el-input v-model="entity.address"></el-input>
				</el-form-item>
				<el-form-item label="状态">
					<el-input v-model="entity.state"></el-input>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="showEntityDialog = false" size="mini">取消</el-button>
				<el-button @click="entityDialogConfirm" size="mini">确定</el-button>
			</div>
		</el-dialog>
		<el-table :data="entityList">
			<el-table-column prop="accountNumber" label="账号"></el-table-column>
			<el-table-column prop="age" label="年龄"></el-table-column>
			<el-table-column prop="balance" label="余额"></el-table-column>
			<el-table-column prop="gender" label="性别"></el-table-column>
			<el-table-column prop="firstname" label="firstname"></el-table-column>
			<el-table-column prop="lastname" label="lastname"></el-table-column>
			<el-table-column prop="email" label="邮箱"></el-table-column>
			<el-table-column prop="employer" label="职位"></el-table-column>
			<el-table-column prop="city" label="所在城市"></el-table-column>
			<el-table-column prop="address" label="地址"></el-table-column>
			<el-table-column prop="state" label="状态"></el-table-column>
			<el-table-column label="操作" width="150" v-if="hasAuth('account:update')||hasAuth('account:delete')">
				<template slot-scope="scope">
					<el-button class="el-icon-edit-outline" @click="showUpdateEntityDialogHandler(scope.$index, scope.row)" v-if="hasAuth('account:update')" type="primary" size="mini"></el-button>
					<el-button class="el-icon-delete-solid" @click="deleteEntity(scope.$index, scope.row)" v-if="hasAuth('account:delete')" type="danger" size="mini"></el-button>
				</template>
			</el-table-column>
		</el-table>
		<el-pagination
			@size-change="sizeChangeHandle" @current-change="currentChangeHandle"
			layout="total, sizes, prev, pager, next, jumper" :current-page="currentPage"
			:page-sizes="[10,15,30,50]" :page-size="pageSize" :total="total">
		</el-pagination>
	</div>
</template>
<script>
	import Mixin4Curd from "../../Mixin4Curd";
	export default {
		name: "Account",
		mixins: [Mixin4Curd],
		data: function () {
			return {
				entityName4LowerCamel:'account',
				entityName4UpperCamel:'Account',
				primaryKey:'accountNumber',
			}
		},
		methods: {
		},
	}
</script>
<style>

</style>
